package propmanager;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.json.JSONException;
import org.json.JSONObject;

import ajaxmethods.AjaxMethod;

public class PropertyManagerPage implements AjaxMethod {

	@Override
	public void perform(HttpServletRequest request, HttpServletResponse response) {
		response.setContentType("text/json");
		 JSONObject propertyManager = new JSONObject();
		StringBuilder sb = new StringBuilder();
		 sb.append("<div id=\"propMgrWrapper\">");
		 sb.append("<div id=\"searchfieldControl\"><a href=\"javascript:void(0);\" onclick=\"toggleSidePanel(this)\"></a></div>");
		 sb.append("<div id=\"mainContent\">" +
		 		"<div class=\"sidepanel\">" +
		 		"<ul class=\"sidenav\"><li><a>My Properties</a>" +
		 		"<ul>" +
		 		"<li><a>Financial Info</a></li>" +
		 		"<li><a>Documents</a></li>" +
		 		"<li><a>Advertise</a></li>" +
		 		"</ul>" +
		 		"</li></ul>" +
		 		"<ul class=\"sidenav\"><li><a>Advertise</a></li></ul>" +
		 		"<ul class=\"sidenav\"><li><a>Find Service Provider</a></li></ul>" +
		 		"<ul class=\"sidenav\"><li><a>Cash Flow Tracker</a></li></ul>" +
		 		"</div>");
		 sb.append("<div id=\"contentpanel\"></div>");
		 sb.append("</div></div>");
		 try {
			propertyManager.put("propManager", sb.toString()).write(response.getWriter());
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
